<!DOCTYPE html>
<html  xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">

    <title></title>
    <!-- 引入 jQuery Mobile 样式 -->
    <link rel="stylesheet" href="http://apps.bdimg.com/libs/jquerymobile/1.4.5/jquery.mobile-1.4.5.min.css">
    <!-- 引入 jQuery 库 -->
    <script src="http://apps.bdimg.com/libs/jquery/1.10.2/jquery.min.js"></script>
    <!-- 引入 jQuery Mobile 库 -->
    <script src="http://apps.bdimg.com/libs/jquerymobile/1.4.5/jquery.mobile-1.4.5.min.js"></script>


    <link href="https://cdn.bootcss.com/jquery-mobile/1.4.5/jquery.mobile.theme.css" rel="stylesheet">

    <script src="https://cdn.bootcss.com/jquery-validate/1.16.0/jquery.validate.js"></script>
    <script src="https://cdn.bootcss.com/jquery.form/4.2.1/jquery.form.js"></script>
    <script src="js/jquerymobile_popup.js" th:src="@{/js/jquerymobile_popup.js}"></script>
    <script type="text/javascript">
        function login(){
            //	openPopup('信息提示','提示',undefined,true,undefined,'error','cn');
            //	WeixinJSBridge.call('closeWindow');

            var email = $("#email").val();
            var wid = $("#wid").val();
            if (email.length<1){
                // alert("邮箱不能为空");
                openPopup('邮箱不能为空','提示',undefined,true,undefined,'error','cn');
                return ;
            }

            $.ajax({
                type:"post",
                url:"[[@{/user/login}]]",
                data:{"email":email,"wid":wid},
                success:function (msg) {
                    if (msg==1){
                        // alert("您输入的邮箱不存在，请联系所在区负责人");
                        openPopup('您输入的邮箱不存在','提示',undefined,true,undefined,'error','cn');
                    }else if (msg==2){
                        // alert("登陆成功");
                        WeixinJSBridge.call('closeWindow');
                    }else {
                        // alert("您输入的邮箱已被其它用户登录，请联系管理员");
                        openPopup('您输入的邮箱已被其它用户登录，如有疑问请联系管理员','提示',undefined,true,undefined,'error','cn');
                    }
                }

            });

        }
    </script>
    <style type="text/css">
        .ui-page{
            background:#eee;
        }
    </style>
</head>
<body>
<div data-role="page" id="pageMain" style="background-color: #4E90C7;">
    <div style="text-align:center;"><img th:src="@{/images/dada_logo1.png}" src="images/dada_logo1.png" style="width: 100%;"></div>
        <input type="hidden" id="wid" name="wid" th:value="${wid}">
    <div data-role="content" class="content">
        <form id="login_params" method="post" >
            <div>
                <input type="text" id="email" name="email" placeholder="公司邮箱" style="background: url('/images/ic_mail.png') no-repeat 5px;background-size: 30px;padding-left:40px;">

            </div>
            <div align="center" style="padding-top:30px;">
                <input id="pubBtn" type="button" value="登录"  onclick="login();" style="padding:10px;background: #E57330;text-shadow: none;opacity:100;color:white;font-size:20px;text-indent:0px;font-family:微软雅黑;border: none;-webkit-appearance:none;-moz-appearance:none;width: 100%;border-radius:7px;" >
            </div>
        </form>

    </div>
</div>


</body>
</html>